<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%
	String context = request.getContextPath();
%>
<html>
<head>
	<title>修改方法</title>
	<link rel="stylesheet" href="<%=context %>/Source/lib/layui/css/layui.css">
</head>
<body style="margin: 0;">
<%-- 表单 --%>
<div class="layui-form" id="form1" style="margin-right: 50px;margin-top: 30px">
	<input id="processId" type="hidden"/>
	<div class="layui-form-item">
		<label class="layui-form-label">流程</label>
		<div class="layui-input-block">
			<select id="process" name="process">
			</select>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">方法名称</label>
		<div class="layui-input-block">
			<input id="functionName" name="functionName" type="text" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">执行接口</label>
		<div class="layui-input-block">
			<input id="execUrl" name="execUrl" type="text" class="layui-input">
		</div>
	</div>
</div>
</body>
<script src="<%=context %>/gooflow/jquery.min.js"></script>
<script src="<%=context %>/Source/lib/layui/layui.js"></script>
<script type="text/javascript">
    var _path = '<%=context %>'+"/flow/function";
    var processList = ${processList};
    var process = ${process};
    $(function () {
        $("#process").empty();
        $("#process").append('<option value="">--请选择--</option>');
        $.each(processList,function(index,obj){
           $("#process").append('<option value="'+obj.processKey+'">'+obj.processName+'</option>');
        });
        if(process){
            $("#processId").val(process.id);
            $("#process").val(process.processId);
            $("#functionName").val(process.functionName);
            $("#execUrl").val(process.execUrl);
        }
    });
    function getData(){
        var data = {
            "id":$("#processId").val(),
            "processId":$("#process").val(),
            "functionName":$("#functionName").val().trim(),
            "execUrl":$("#execUrl").val().trim()
        };
        return JSON.stringify(data)
    }

    var form;
    layui.use('form', function(){
        form = layui.form;
        form.render('select');

    });

</script>
</html>
